home *** CD-ROM | disk | FTP | other *** search
/ Inter.Net 55-1 / Inter.Net 55-1.iso / CBuilder / Setup / BCB / data.z / stdwind.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-02-09  |  7.4 KB  |  204 lines

  1. #ifndef __RWSTDWIND_H__
  2. #define __RWSTDWIND_H__
  3. #pragma option push -b -a4 -Vx- -Ve- -w-inl -w-aus -w-sig
  4.  
  5. /***************************************************************************
  6.  *
  7.  * stdwind.h - Microsoft Windows related directives.
  8.  *
  9.  * $Id: stdwind.h,v 1.19 1996/09/24 19:42:16 smithey Exp $
  10.  *
  11.  ***************************************************************************
  12.  *
  13.  * (c) Copyright 1994, 1995 Rogue Wave Software, Inc.
  14.  * ALL RIGHTS RESERVED *
  15.  * The software and information contained herein are proprietary to, and
  16.  * comprise valuable trade secrets of, Rogue Wave Software, Inc., which
  17.  * intends to preserve as trade secrets such software and information.
  18.  * This software is furnished pursuant to a written license agreement and
  19.  * may be used, copied, transmitted, and stored only in accordance with
  20.  * the terms of such license and with the inclusion of the above copyright
  21.  * notice.  This software and information or any other copies thereof may
  22.  * not be provided or otherwise made available to any other person.
  23.  *
  24.  * Notwithstanding any other lease or license that may pertain to, or
  25.  * accompany the delivery of, this computer software and information, the
  26.  * rights of the Government regarding its use, reproduction and disclosure
  27.  * are as set forth in Section 52.227-19 of the FARS Computer
  28.  * Software-Restricted Rights clause.
  29.  *
  30.  * Use, duplication, or disclosure by the Government is subject to
  31.  * restrictions as set forth in subparagraph (c)(1)(ii) of the Rights in
  32.  * Technical Data and Computer Software clause at DFARS 252.227-7013.
  33.  * Contractor/Manufacturer is Rogue Wave Software, Inc.,
  34.  * P.O. Box 2328, Corvallis, Oregon 97339.
  35.  *
  36.  * This computer software and information is distributed with "restricted
  37.  * rights."  Use, duplication or disclosure is subject to restrictions as
  38.  * set forth in NASA FAR SUP 18-52.227-79 (April 1985) "Commercial
  39.  * Computer Software-Restricted Rights (April 1985)."  If the Clause at
  40.  * 18-52.227-74 "Rights in Data General" is specified in the contract,
  41.  * then the "Alternate III" clause applies.
  42.  *
  43.  **************************************************************************/
  44.  
  45. /*
  46.  * Special stuff for 16-bit Windows (__WIN16__)
  47.  * and Windows NT / Win32s (__WIN32__).
  48.  *
  49.  * Under Windows, these header files can be used in two different modes:
  50.  * as part of a DLL, or as part of a regular (static) library.
  51.  * For each of these two ways, we can either be COMPILING the library,
  52.  * or USING the library.  This makes a matrix of four possible situations.
  53.  *
  54.  *************************************************************************
  55.  ******************************  DLL *************************************
  56.  *************************************************************************
  57.  *
  58.  *                         Creating a DLL
  59.  *
  60.  * The macro __DLL__ should be define when compiling to create a DLL.
  61.  *
  62.  *     The Borland compilers automatically do this if either the -WD or
  63.  *     -WDE switch is being used.  In this situation, the macro
  64.  *     _RWSTDExport expands to _export.
  65.  *
  66.  *     For other compilers, we must define __DLL__ where appropriate
  67.  *     if the compiler doesn't.  See the example for Microsoft below.
  68.  *
  69.  *     _RWSTDExport expands to _export by default.  Massage as
  70.  *     necessary for your compiler; again see below for the Microsoft
  71.  *     specific directives.
  72.  *
  73.  *                       Using the resultant DLL
  74.  *
  75.  * In order to use the resultant DLL, you must define the macro _RWSTDDLL
  76.  * when compiling.  This will communicate to the Rogue Wave header files
  77.  * your intention to use a DLL version of the Rogue Wave library.
  78.  *
  79.  * If you intend to use a DLL version of the Borland RTL as well, then you
  80.  * should also define the macro _RTLDLL, as per Borland's instructions.
  81.  *
  82.  * You must also specify the -WS switch ("smart callbacks") for the
  83.  * Borland Compiler.
  84.  *
  85.  *
  86.  *************************************************************************
  87.  ***********************  Static Windows Library **************************
  88.  *************************************************************************
  89.  *
  90.  *
  91.  *                Creating a _RW static Windows library
  92.  *
  93.  * If your intention is to create a Rogue Wave library to be used as 
  94.  * as a static Windows library, then one of the macros __WIN16__ or __WIN32__
  95.  * must have been defined in compiler.h (or by the compiler directly).
  96.  *
  97.  * Borland:    __WIN16__ will be defined if both _Windows and __MSDOS__ 
  98.  *              is defined.  _Windows will be defined automatically if 
  99.  *              any -W switch is used.  Borland defines __WIN32__ automatically
  100.  *              in their 32-bit compiler for Windows NT / Win32s.
  101.  *
  102.  * Microsoft:    Microsoft automatically defines _WINDOWS if you use the
  103.  *        /GA (preferred) or /GW switch. 
  104.  *              __WIN32__ will only be defined if either it, or WIN32,
  105.  *              is _EXPLICITly defined on the cl command line.
  106.  *
  107.  * 
  108.  *                 Using a _RW static Windows library
  109.  *
  110.  * Nothing special needs to be done.  Just link compile with the appropriate
  111.  * compile switches and link in the _RW static Windows library.
  112.  *
  113.  */
  114.  
  115.  
  116. /*
  117.  * Check for Microsoft C/C++ and massage as necessary.
  118.  */
  119. #if defined(_MSC_VER)
  120. #  if defined(_WINDLL) && !defined(__DLL__)
  121. #    define __DLL__ 1
  122. #  endif
  123. #  if !defined(_export)
  124. #    define _export __export
  125. #  endif
  126. #endif
  127.  
  128. #ifdef  __TURBOC__
  129. #  if __TURBOC__ > 0x468
  130. #    define _RWSTD_EXPORT_TEMPLATE
  131. #  endif
  132. #endif
  133.  
  134.  
  135. /* For backwards compatibility: */
  136. #if defined(_RWSTDCLASSDLL) && !defined(_RWSTDDLL)
  137. # define _RWSTDDLL 1
  138. #endif
  139.  
  140. #if defined(_RWSTDDLL)
  141. #  if !defined(__LARGE__) && !defined(__WIN32__)
  142. #    error   Must use large or flat memory model when compiling or using the Standard Library DLL!
  143. #  endif
  144. #  if defined(_RWSTDBUILDDLL)
  145.      // Compiling the DLL.
  146. #    ifndef _MSC_VER
  147. #      define _RWSTDExport _export            /* Mark classes as exported */
  148. #      if defined (__WIN16__)
  149. #        define _RWSTDHuge huge
  150. #      else
  151. #        define _RWSTDHuge
  152. #      endif
  153. #      ifdef _RWSTD_EXPORT_TEMPLATE
  154. #        define _RWSTDExportTemplate _export    /* Mark template insts as exported */
  155. #      else
  156. #        define _RWSTDExportTemplate 
  157. #      endif
  158. #    else /* Microsoft: */
  159. #      define _RWSTDExport __declspec(dllexport)
  160. #      define _RWSTDExportTemplate              
  161. #      define _RWSTDHuge
  162. #    endif
  163. #  else
  164.      // Using the DLL.
  165. #    if defined(__WIN16__)
  166. #      define _RWSTDExport huge     /* Mark classes as huge  */
  167. #      define _RWSTDHuge huge
  168. #    else
  169. #      ifndef _MSC_VER
  170. #        define _RWSTDExport _import
  171. #      else
  172. #        define _RWSTDExport  __declspec(dllimport)
  173. #        ifndef _RWSTD_EXPORT_TEMPLATE
  174. #          define _RWSTDExportTemplate
  175. #        endif
  176. #      endif  
  177. #      define _RWSTDHuge
  178. #    endif
  179. #    ifdef _RWSTD_EXPORT_TEMPLATE
  180. #      define _RWSTDExportTemplate _import
  181. #    else
  182. #      define _RWSTDExportTemplate 
  183. #    endif
  184.  
  185. #  endif
  186. #else
  187.    // Neither compiling, nor using the  DLL.
  188. #  define _RWSTDExport
  189. #  define _RWSTDExportTemplate 
  190. #  define _RWSTDHuge
  191. #endif
  192.  
  193. //
  194. // Different compilers expect exported functions defined in different ways.
  195. //
  196. #ifdef _MSC_VER
  197. #define _RWSTDExportFunc(ReturnType) _RWSTDExport ReturnType
  198. #else
  199. #define _RWSTDExportFunc(ReturnType) ReturnType _RWSTDExport 
  200. #endif
  201.  
  202. #pragma option pop
  203. #endif // __RWSTDWIND_H__
  204.